package cn.edu.hust.sse.software7.class3.entities;

import java.io.Serializable;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

/**
 * This is the shopping car of ebusiness, user can add some product to his
 * shopping car, can also save his shopping car. If not logged, the user cannot
 * add something to the shopping car.
 * 
 * @author mason
 * 
 */
@PersistenceCapable(identityType=IdentityType.APPLICATION)
public class EBShoppingCar implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long shopcarId;
	@Persistent
	private Long userId;
	@Persistent
	private Long productId;

	public EBShoppingCar(Long userId, Long productId) {
		super();
		this.userId = userId;
		this.productId = productId;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}


	public Long getProductId() {
		return productId;
	}

	public void setProductId(Long productId) {
		this.productId = productId;
	}

	public Long getShopcarId() {
		return shopcarId;
	}

	
}
